import request from '@/utils/request'
import { GET_ARTICLES, GET_CHANNELS } from '../constants';
export const getArticles = (params) => {
    return async dispatch => {
        const res = await request.get('/mp/articles', {
            params
        })
        // console.log(res);
        dispatch({
            type: GET_ARTICLES,
            payload: res.data.data
        })
    }
}

export const getChannels = () => {
    return async dispatch => {
        const res = await request.get('/channels')
        // console.log(res)
        dispatch({
            type: GET_CHANNELS,
            payload: res.data.data.channels
        })
    }
}